package com.qk.management.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author: hm
 * @Date: 2025/10/06 20:03
 * @Description:
 */
@Mapper
public interface RoleMapper {

    @Select("select * from role")
    List<Role> selectAllRoles();

    @Select("select * from role where label = #{roleLabel}")
    Role selectByRoleLabel(String roleLabel);

    @Select("select * from role where id = #{roleId}")
    Role selectById(Integer roleId);

    @Delete("delete from role where id = #{id}")
    void deleteById(Integer id);

    void update(Role role);

    List<Role> selectByPage(String name, String label, Integer offset, Integer pageSize);

    Integer count(String name, String label);

    void insert(Role role);
}
